﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Chapter11.Code01.Code07
{
    using System.Collections;

    public class Demo
    {
        public static void Begin()
        {
            Animals animalCollection = new Animals();
            animalCollection.Add("Jack", new Cow("Jack"));
            animalCollection.Add("Vear", new Chicken("Vear"));
            foreach (Animal myAnimal in animalCollection)
            {
                Console.WriteLine("New {0} object added to ArrayList collection, Name = {1}", myAnimal.ToString(), myAnimal.Name);
            }
            Console.ReadLine();
        }
    }
}
